package message;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class AuthenticationResponseMessage extends Message
{
	private static final long serialVersionUID = 1L;
	private boolean successSet = false;
	private boolean success;
	
	public boolean isSuccess()
	{
		return success;
	}
	@XmlElement(name = "success", required = true, defaultValue = "false")
	public void setSuccess(boolean success)
	{
		if (!successSet)
		{
			this.success = success;
			successSet = true;
		}
	}
	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + (success ? 1231 : 1237);
		return result;
	}
	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AuthenticationResponseMessage other = (AuthenticationResponseMessage) obj;
		if (success != other.success)
			return false;
		return true;
	}
	
}
